﻿package org.libspark.betweenas3.easing
{
	import org.libspark.betweenas3.core.easing.IPhysicalEasing;
	import org.libspark.betweenas3.core.easing.PhysicalAccelerate;
	import org.libspark.betweenas3.core.easing.PhysicalExponential;
	import org.libspark.betweenas3.core.easing.PhysicalUniform;
	
	/**
	 * Physical.
	 * 
	 * @author	yossy:beinteractive
	 */
	public class Physical
	{
        public static var defaultFrameRate:Number = 30.0;
	
        
		public static function uniform(velocity:Number = 10.0, frameRate:Number = NaN):IPhysicalEasing
		{
			return new PhysicalUniform(velocity, isNaN(frameRate) ? defaultFrameRate : frameRate);
		}
		
		public static function accelerate(acceleration:Number = 1.0, initialVelocity:Number = 0.0, frameRate:Number = NaN):IPhysicalEasing
		{
			return new PhysicalAccelerate(initialVelocity, acceleration, isNaN(frameRate) ? defaultFrameRate : frameRate);
		}
		
		public static function exponential(factor:Number = 0.2, threshold:Number = 0.0001, frameRate:Number = NaN):IPhysicalEasing
		{
			return new PhysicalExponential(factor, threshold, isNaN(frameRate) ? defaultFrameRate : frameRate);
		}
	}
}